// 在你的 Vuex store 中
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        clickedBrandId: null,
        subCategories: null, // 添加 subCategories
        parentCategoryName: null,
    },
    mutations: {
        setClickedBrandId(state, id) {
            state.clickedBrandId = id;
        },
        setSubCategories(state, categories) {
            state.subCategories = categories;
        },
        setParentCategoryName(state, name) {
            state.parentCategoryName = name;
        },
    },
});
